// EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
// The Regents of the University of California, through Lawrence Berkeley National Laboratory
// (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
// National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
// contributors. All rights reserved.
//
// NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
// U.S. Government consequently retains certain rights. As such, the U.S. Government has been
// granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
// worldwide license in the Software to reproduce, distribute copies to the public, prepare
// derivative works, and perform publicly and display publicly, and to permit others to do so.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// (1) Redistributions of source code must retain the above copyright notice, this list of
//     conditions and the following disclaimer.
//
// (2) Redistributions in binary form must reproduce the above copyright notice, this list of
//     conditions and the following disclaimer in the documentation and/or other materials
//     provided with the distribution.
//
// (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
//     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
//     used to endorse or promote products derived from this software without specific prior
//     written permission.
//
// (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
//     without changes from the version obtained under this License, or (ii) Licensee makes a
//     reference solely to the software portion of its product, Licensee must refer to the
//     software as "EnergyPlus version X" software, where "X" is the version number Licensee
//     obtained under this License and may not use a different name for the software. Except as
//     specifically required in this Section (4), Licensee shall not use in a company name, a
//     product name, in advertising, publicity, or other promotional activities any name, trade
//     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
//     similar designation, without the U.S. Department of Energy's prior written consent.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

// EnergyPlus::OA System Hot Water Preheat Coil Simulation Test

// Google Test Headers
#include <gtest/gtest.h>

// EnergyPlus Headers
#include "Fixtures/EnergyPlusFixture.hh"
#include <EnergyPlus/DataAirLoop.hh>
#include <EnergyPlus/DataLoopNode.hh>
#include <EnergyPlus/HVACControllers.hh>
#include <EnergyPlus/IOFiles.hh>
#include <EnergyPlus/MixedAir.hh>
#include <EnergyPlus/OutputProcessor.hh>
#include <EnergyPlus/Psychrometrics.hh>
#include <EnergyPlus/SimulationManager.hh>
#include <EnergyPlus/WaterCoils.hh>

using namespace EnergyPlus;
using namespace EnergyPlus::DataAirLoop;
using namespace EnergyPlus::DataLoopNode;
using namespace EnergyPlus::HVACControllers;
using namespace EnergyPlus::MixedAir;
using namespace EnergyPlus::OutputProcessor;
using namespace EnergyPlus::Psychrometrics;
using namespace EnergyPlus::SimulationManager;
using namespace EnergyPlus::WaterCoils;

namespace EnergyPlus {

TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOffSim)
{

    int AirLoopNum(1);
    int OASysNum(1);

    std::string const idf_objects = delimited_string({
        "  Timestep, 4;",

        "  SimulationControl,",
        "    Yes,                     !- Do Zone Sizing Calculation",
        "    Yes,                     !- Do System Sizing Calculation",
        "    No,                      !- Do Plant Sizing Calculation",
        "    Yes,                     !- Run Simulation for Sizing Periods",
        "    No;                      !- Run Simulation for Weather File Run Periods",

        "  RunPeriod,",
        "    RP1,                     !- Name",
        "    1,                       !- Begin Month",
        "    1,                       !- Begin Day of Month",
        "    ,                        !- Begin Year",
        "    12,                      !- End Month",
        "    31,                      !- End Day of Month",
        "    ,                        !- End Year",
        "    Tuesday,                 !- Day of Week for Start Day",
        "    Yes,                     !- Use Weather File Holidays and Special Days",
        "    Yes,                     !- Use Weather File Daylight Saving Period",
        "    No,                      !- Apply Weekend Holiday Rule",
        "    Yes,                     !- Use Weather File Rain Indicators",
        "    Yes;                     !- Use Weather File Snow Indicators",

        "  Site:Location,",
        "    CHICAGO_IL_USA TMY2-94846,  !- Name",
        "    41.78,                   !- Latitude {deg}",
        "    -87.75,                  !- Longitude {deg}",
        "    -6.00,                   !- Time Zone {hr}",
        "    190.00;                  !- Elevation {m}",

        "  SizingPeriod:DesignDay,",
        "    CHICAGO_IL_USA Annual Heating 99% Design Conditions DB,  !- Name",
        "    1,                       !- Month",
        "    21,                      !- Day of Month",
        "    WinterDesignDay,         !- Day Type",
        "    -17.3,                   !- Maximum Dry-Bulb Temperature {C}",
        "    0.0,                     !- Daily Dry-Bulb Temperature Range {deltaC}",
        "    ,                        !- Dry-Bulb Temperature Range Modifier Type",
        "    ,                        !- Dry-Bulb Temperature Range Modifier Day Schedule Name",
        "    Wetbulb,                 !- Humidity Condition Type",
        "    -17.3,                   !- Wetbulb or DewPoint at Maximum Dry-Bulb {C}",
        "    ,                        !- Humidity Condition Day Schedule Name",
        "    ,                        !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir}",
        "    ,                        !- Enthalpy at Maximum Dry-Bulb {J/kg}",
        "    ,                        !- Daily Wet-Bulb Temperature Range {deltaC}",
        "    99063.,                  !- Barometric Pressure {Pa}",
        "    4.9,                     !- Wind Speed {m/s}",
        "    270,                     !- Wind Direction {deg}",
        "    No,                      !- Rain Indicator",
        "    No,                      !- Snow Indicator",
        "    No,                      !- Daylight Saving Time Indicator",
        "    ASHRAEClearSky,          !- Solar Model Indicator",
        "    ,                        !- Beam Solar Day Schedule Name",
        "    ,                        !- Diffuse Solar Day Schedule Name",
        "    ,                        !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless}",
        "    ,                        !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless}",
        "    0.0;                     !- Sky Clearness",

        "  BranchList,",
        "    Air Loop Branches,       !- Name",
        "    Air Loop Main Branch;    !- Branch 1 Name",

        "  Branch,",
        "    Air Loop Main Branch,    !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    AirLoopHVAC:OutdoorAirSystem,  !- Component 1 Object Type",
        "    OA Sys 1,                !- Component 1 Name",
        "    Outdoor Air Mixer Inlet Node,  !- Component 1 Inlet Node Name",
        "    Mixed Air Node,          !- Component 1 Outlet Node Name",
        "    Fan:ConstantVolume,      !- Component 2 Object Type",
        "    Supply Fan 1,            !- Component 2 Name",
        "    Mixed Air Node,          !- Component 2 Inlet Node Name",
        "    Air Loop Outlet Node;    !- Component 2 Outlet Node Name",

        "  AirLoopHVAC,",
        "    DOAS,                    !- Name",
        "    ,                        !- Controller List Name",
        "    Outdoor Air 1 Avail List,!- Availability Manager List Name",
        "    0.0625,                  !- Design Supply Air Flow Rate {m3/s}",
        "    Air Loop Branches,       !- Branch List Name",
        "    ,                        !- Connector List Name",
        "    Outdoor Air Mixer Inlet Node,  !- Supply Side Inlet Node Name",
        "    Return Air Mixer Outlet, !- Demand Side Outlet Node Name",
        "    Zone Equipment Inlet Node,  !- Demand Side Inlet Node Names",
        "    Air Loop Outlet Node;    !- Supply Side Outlet Node Names",

        "  AirLoopHVAC:SupplyPath,",
        "    OASysSupplyPath,         !- Name",
        "    Zone Equipment Inlet Node,  !- Supply Air Path Inlet Node Name",
        "    AirLoopHVAC:ZoneSplitter,!- Component 1 Object Type",
        "    Zone Supply Air Splitter;!- Component 1 Name",

        "  AirLoopHVAC:ReturnPath,",
        "    OASysReturnPath,         !- Name",
        "    Return Air Mixer Outlet, !- Return Air Path Outlet Node Name",
        "    AirLoopHVAC:ZoneMixer,   !- Component 1 Object Type",
        "    Zone Return Air Mixer;   !- Component 1 Name",

        "  AirLoopHVAC:ZoneSplitter,",
        "    Zone Supply Air Splitter,!- Name",
        "    Zone Equipment Inlet Node,  !- Inlet Node Name",
        "    Zone 1 OA Inlet Node 2AT;    !- Outlet 1 Node Name",

        "  AirLoopHVAC:ZoneMixer,",
        "    Zone Return Air Mixer,   !- Name",
        "    Return Air Mixer Outlet, !- Outlet Node Name",
        "    Zone 1 Return Node;      !- Inlet 1 Node Name",

        "  AirLoopHVAC:ControllerList,",
        "    OA Sys 1 Controllers,    !- Name",
        "    Controller:OutdoorAir,   !- Controller 1 Object Type",
        "    OA Controller 1,         !- Controller 1 Name",
        "    Controller:WaterCoil,    !- Controller 2 Object Type",
        "    Preheat Coil Controller; !- Controller 2 Name",

        "  Controller:WaterCoil,",
        "    Preheat Coil Controller, !- Name",
        "    Temperature,             !- Control Variable",
        "    Normal,                  !- Action",
        "    Flow,                    !- Actuator Variable",
        "    HW Coil Air OutletNode,  !- Sensor Node Name",
        "    HWCoil Water InletNode,  !- Actuator Node Name",
        "    Autosize,                !- Controller Convergence Tolerance {deltaC}",
        "    Autosize,                !- Maximum Actuated Flow {m3/s}",
        "    0;                       !- Minimum Actuated Flow {m3/s}",

        "  AirLoopHVAC:OutdoorAirSystem:EquipmentList,",
        "    OA Sys 1 Equipment,      !- Name",
        "    Coil:Heating:Water,      !- Component 1 Object Type",
        "    OA Preheat HW Coil,      !- Component 1 Name",
        "    OutdoorAir:Mixer,        !- Component 1 Object Type",
        "    OA Mixing Box;           !- Component 1 Name",

        "  AirLoopHVAC:OutdoorAirSystem,",
        "    OA Sys 1,                !- Name",
        "    OA Sys 1 Controllers,    !- Controller List Name",
        "    OA Sys 1 Equipment;      !- Outdoor Air Equipment List Name",

        "  OutdoorAir:NodeList,",
        "    OUTSIDE AIR INLET NODE;    !- Node or NodeList Name 1",

        "  OutdoorAir:Mixer,",
        "    OA Mixing Box,           !- Name",
        "    Mixed Air Node,          !- Mixed Air Node Name",
        "    HW Coil Air OutletNode,  !- Outdoor Air Stream Node Name",
        "    Relief Air Outlet Node,  !- Relief Air Stream Node Name",
        "    Outdoor Air Mixer Inlet Node;  !- Return Air Stream Node Name",

        "  AvailabilityManagerAssignmentList,",
        "    Outdoor Air 1 Avail List,!- Name",
        "    AvailabilityManager:Scheduled,  !- Availability Manager 1 Object Type",
        "    Outdoor Air 1 Avail;     !- Availability Manager 1 Name",

        "  AvailabilityManager:Scheduled,",
        "    Outdoor Air 1 Avail,     !- Name",
        "    FanAndCoilAvailSched;    !- Schedule Name",

        "  SetpointManager:MixedAir,",
        "    Mixed Air Temp Manager 1,!- Name",
        "    Temperature,             !- Control Variable",
        "    Air Loop Outlet Node,    !- Reference Setpoint Node Name",
        "    Mixed Air Node,          !- Fan Inlet Node Name",
        "    Air Loop Outlet Node,    !- Fan Outlet Node Name",
        "    Mixed Air Node;          !- Setpoint Node or NodeList Name",

        "  SetpointManager:Scheduled,",
        "    HW Coil Air Temp Manager,!- Name",
        "    Temperature,             !- Control Variable",
        "    Schedule_Constant_11.6,  !- Schedule Name",
        "    HW Coil Air OutletNode;  !- Setpoint Node or NodeList Name",

        "  Schedule:Constant,Schedule_Constant_11.6,Temperature,11.6;",

        "  Controller:OutdoorAir,",
        "    OA Controller 1,         !- Name",
        "    Relief Air Outlet Node,  !- Relief Air Outlet Node Name",
        "    Outdoor Air Mixer Inlet Node,  !- Return Air Node Name",
        "    Mixed Air Node,          !- Mixed Air Node Name",
        "    Outside Air Inlet Node,  !- Actuator Node Name",
        "    0.0625,                  !- Minimum Outdoor Air Flow Rate {m3/s}",
        "    0.0625,                  !- Maximum Outdoor Air Flow Rate {m3/s}",
        "    DifferentialDrybulb,     !- Economizer Control Type",
        "    ModulateFlow,            !- Economizer Control Action Type",
        "    23.,                     !- Economizer Maximum Limit Dry-Bulb Temperature {C}",
        "    ,                        !- Economizer Maximum Limit Enthalpy {J/kg}",
        "    13.5,                    !- Economizer Maximum Limit Dewpoint Temperature {C}",
        "    ,                        !- Electronic Enthalpy Limit Curve Name",
        "    14.,                     !- Economizer Minimum Limit Dry-Bulb Temperature {C}",
        "    NoLockout,               !- Lockout Type",
        "    FixedMinimum,            !- Minimum Limit Type",
        "    OAFractionSched,         !- Minimum Outdoor Air Schedule Name",
        "    ,                        !- Minimum Fraction of Outdoor Air Schedule Name",
        "    ,                        !- Maximum Fraction of Outdoor Air Schedule Name",
        "    ;                        !- Mechanical Ventilation Controller Name",

        "  Fan:ConstantVolume,",
        "    Supply Fan 1,            !- Name",
        "    FanAndCoilAvailSched,    !- Availability Schedule Name",
        "    0.7,                     !- Fan Total Efficiency",
        "    600.0,                   !- Pressure Rise {Pa}",
        "    0.0625,                  !- Maximum Flow Rate {m3/s}",
        "    0.9,                     !- Motor Efficiency",
        "    1.0,                     !- Motor In Airstream Fraction",
        "    Mixed Air Node,          !- Air Inlet Node Name",
        "    Air Loop Outlet Node;    !- Air Outlet Node Name",

        "  AirTerminal:SingleDuct:ConstantVolume:NoReheat,",
        "    Zone1DirectAir,          !- Name",
        "    FanAndCoilAvailSched,    !- Availability Schedule Name",
        "    Zone 1 OA Inlet Node 2AT,!- Air Inlet Node Name",
        "    Zone 1 OA Inlet Node,    !- Air Outlet Node Name",
        "    0.0625;                  !- Maximum Air Flow Rate {m3/s}",

        "  Schedule:Compact,",
        "    OAFractionSched,         !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.5;        !- Field 3",

        "  SetpointManager:SingleZone:Reheat,",
        "    Supply Air Temp Manager, !- Name",
        "    Temperature,             !- Control Variable",
        "    14.0,                    !- Minimum Supply Air Temperature {C}",
        "    40.0,                    !- Maximum Supply Air Temperature {C}",
        "    SPACE1-1,                !- Control Zone Name",
        "    Zone 1 Node,             !- Zone Node Name",
        "    Zone 1 OA Inlet Node,    !- Zone Inlet Node Name",
        "    Air Loop Outlet Node;    !- Setpoint Node or NodeList Name",

        "  Sizing:System,",
        "    DOAS,                    !- AirLoop Name",
        "    Sensible,                !- Type of Load to Size On",
        "    autosize,                !- Design Outdoor Air Flow Rate {m3/s}",
        "    1.0,                     !- Central Heating Maximum System Air Flow Ratio",
        "    40.0,                    !- Preheat Design Temperature {C}",
        "    0.008,                   !- Preheat Design Humidity Ratio {kgWater/kgDryAir}",
        "    15.56,                   !- Precool Design Temperature {C}",
        "    0.008,                   !- Precool Design Humidity Ratio {kgWater/kgDryAir}",
        "    12.78,                   !- Central Cooling Design Supply Air Temperature {C}",
        "    12.78,                   !- Central Heating Design Supply Air Temperature {C}",
        "    NonCoincident,           !- Type of Zone Sum to Use",
        "    No,                      !- 100% Outdoor Air in Cooling",
        "    No,                      !- 100% Outdoor Air in Heating",
        "    0.0085,                  !- Central Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir}",
        "    0.008,                   !- Central Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir}",
        "    Flow/System,             !- Cooling Supply Air Flow Rate Method",
        "    8.287,                   !- Cooling Supply Air Flow Rate {m3/s}",
        "    0.0099676501,            !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2}",
        "    1,                       !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate",
        "    3.9475456e-005,          !- Cooling Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}",
        "    Flow/System,             !- Heating Supply Air Flow Rate Method",
        "    0.338942175,             !- Heating Supply Air Flow Rate {m3/s}",
        "    0.0099676501,            !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2}",
        "    1,                       !- Heating Fraction of Autosized Heating Supply Air Flow Rate",
        "    1,                       !- Heating Fraction of Autosized Cooling Supply Air Flow Rate",
        "    3.1588213e-005,          !- Heating Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}",
        "    ZoneSum,                 !- System Outdoor Air Method",
        "    1,                       !- Zone Maximum Outdoor Air Fraction {dimensionless}",
        "    CoolingDesignCapacity,   !- Cooling Design Capacity Method",
        "    Autosize,                !- Cooling Design Capacity {W}",
        "    234.7,                   !- Cooling Design Capacity Per Floor Area {W/m2}",
        "    1,                       !- Fraction of Autosized Cooling Design Capacity",
        "    HeatingDesignCapacity,   !- Heating Design Capacity Method",
        "    Autosize,                !- Heating Design Capacity {W}",
        "    157,                     !- Heating Design Capacity Per Floor Area {W/m2}",
        "    1,                       !- Fraction of Autosized Heating Design Capacity",
        "    VAV;                     !- Central Cooling Capacity Control Method",
        "	",

        "  Site:GroundTemperature:Deep,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5;",

        "  Sizing:Parameters,",
        "    1.3,                     !- Heating Sizing Factor",
        "    1.3,                     !- Cooling Sizing Factor",
        "    ;                        !- Timesteps in Averaging Window",

        "  Sizing:Zone,",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    SupplyAirTemperature,    !- Zone Cooling Design Supply Air Temperature Input Method",
        "    13.,                     !- Zone Cooling Design Supply Air Temperature {C}",
        "    ,                        !- Zone Cooling Design Supply Air Temperature Difference {deltaC}",
        "    SupplyAirTemperature,    !- Zone Heating Design Supply Air Temperature Input Method",
        "    30.,                     !- Zone Heating Design Supply Air Temperature {C}",
        "    ,                        !- Zone Heating Design Supply Air Temperature Difference {deltaC}",
        "    0.0075,                  !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir}",
        "    0.004,                   !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir}",
        "    SZ DSOA SPACE1-1,        !- Design Specification Outdoor Air Object Name",
        "    0.0,                     !- Zone Heating Sizing Factor",
        "    0.0,                     !- Zone Cooling Sizing Factor",
        "    DesignDay,               !- Cooling Design Air Flow Method",
        "    0,                       !- Cooling Design Air Flow Rate {m3/s}",
        "    ,                        !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2}",
        "    ,                        !- Cooling Minimum Air Flow {m3/s}",
        "    ,                        !- Cooling Minimum Air Flow Fraction",
        "    DesignDay,               !- Heating Design Air Flow Method",
        "    0,                       !- Heating Design Air Flow Rate {m3/s}",
        "    ,                        !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2}",
        "    ,                        !- Heating Maximum Air Flow {m3/s}",
        "    ;                        !- Heating Maximum Air Flow Fraction",

        "  DesignSpecification:OutdoorAir,",
        "    SZ DSOA SPACE1-1,        !- Name",
        "    flow/person,             !- Outdoor Air Method",
        "    0.0125,                  !- Outdoor Air Flow per Person {m3/s-person}",
        "    0.0,                     !- Outdoor Air Flow per Zone Floor Area {m3/s-m2}",
        "    0.0;                     !- Outdoor Air Flow per Zone {m3/s}",

        "  People,",
        "    SPACE1-1 PEOPLE,         !- Name",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    OFFICE OCCUPANCY,        !- Number of People Schedule Name",
        "    people,                  !- Number of People Calculation Method",
        "    5.000000,                !- Number of People",
        "    ,                        !- People per Zone Floor Area {person/m2}",
        "    ,                        !- Zone Floor Area per Person {m2/person}",
        "    0.3000000,               !- Fraction Radiant",
        "    ,                        !- Sensible Heat Fraction",
        "    Activity Sch,            !- Activity Level Schedule Name",
        "    3.82E-8,                 !- Carbon Dioxide Generation Rate {m3/s-W}",
        "    ,                        !- Enable ASHRAE 55 Comfort Warnings",
        "    EnclosureAveraged,            !- Mean Radiant Temperature Calculation Type",
        "    ,                        !- Surface Name/Angle Factor List Name",
        "    Work Eff Sch,            !- Work Efficiency Schedule Name",
        "    ClothingInsulationSchedule,  !- Clothing Insulation Calculation Method",
        "    ,                        !- Clothing Insulation Calculation Method Schedule Name",
        "    Clothing Sch,            !- Clothing Insulation Schedule Name",
        "    Air Velo Sch,            !- Air Velocity Schedule Name",
        "    FANGER;                  !- Thermal Comfort Model 1 Type",

        "  Schedule:Compact,",
        "    OFFICE OCCUPANCY,        !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 21",
        "    Until: 24:00,1.0;        !- Field 22",

        "  Schedule:Compact,",
        "    Activity Sch,            !- Name",
        "    Any Number,              !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,131.8;      !- Field 3",

        "  Schedule:Compact,",
        "    Work Eff Sch,            !- Name",
        "    Any Number,              !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.0;        !- Field 3",

        "  Schedule:Compact,",
        "    Clothing Sch,            !- Name",
        "    Any Number,              !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  Schedule:Compact,",
        "    Air Velo Sch,            !- Name",
        "    Any Number,              !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.137;      !- Field 3",

        "  Schedule:Compact,",
        "    BLDG_EQUIP_SCH,          !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  ScheduleTypeLimits,",
        "    Any Number;              !- Name",

        "  Lights,",
        "    SPACE1-1 Lights,         !- Name",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    LIGHTS-1,                !- Schedule Name",
        "    LightingLevel,           !- Design Level Calculation Method",
        "    284,                     !- Lighting Level {W}",
        "    ,                        !- Watts per Zone Floor Area {W/m2}",
        "    ,                        !- Watts per Person {W/person}",
        "    0.0,                     !- Return Air Fraction",
        "    0.59,                    !- Fraction Radiant",
        "    0.2,                     !- Fraction Visible",
        "    0,                       !- Fraction Replaceable",
        "    GeneralLights;           !- End-Use Subcategory",

        "  ElectricEquipment,",
        "    SPACE1-1_MiscPlug_Equip, !- Name",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    BLDG_EQUIP_SCH,          !- Schedule Name",
        "    EquipmentLevel,          !- Design Level Calculation Method",
        "    207.7352,                !- Design Level {W}",
        "    ,                        !- Watts per Zone Floor Area {W/m2}",
        "    ,                        !- Watts per Person {W/person}",
        "    0.0000,                  !- Fraction Latent",
        "    0.5000,                  !- Fraction Radiant",
        "    0.0000,                  !- Fraction Lost",
        "    MiscPlug;                !- End-Use Subcategory",

        "  Schedule:Compact,",
        "    LIGHTS-1,                !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  ZoneControl:Thermostat,",
        "    Zone 1 Thermostat,       !- Name",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    Zone Control Type Sched, !- Control Type Schedule Name",
        "    ThermostatSetpoint:DualSetpoint,  !- Control 1 Object Type",
        "    Temperature Setpoints;   !- Control 1 Name",

        "  ThermostatSetpoint:DualSetpoint,",
        "    Temperature Setpoints,   !- Name",
        "    Heating Setpoints,       !- Heating Setpoint Temperature Schedule Name",
        "    Cooling Setpoints;       !- Cooling Setpoint Temperature Schedule Name",

        "  Schedule:Compact,",
        "    Zone Control Type Sched, !- Name",
        "    Control Type,            !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,4;          !- Field 3",

        "  ScheduleTypeLimits,",
        "    Control Type,            !- Name",
        "    0,                       !- Lower Limit Value",
        "    4,                       !- Upper Limit Value",
        "    DISCRETE;                !- Numeric Type",

        "  ScheduleTypeLimits,",
        "    Temperature,             !- Name",
        "    -60,                     !- Lower Limit Value",
        "    200,                     !- Upper Limit Value",
        "    CONTINUOUS,              !- Numeric Type",
        "    Temperature;             !- Unit Type",

        "  ScheduleTypeLimits,",
        "    Fraction,                !- Name",
        "    0.0,                     !- Lower Limit Value",
        "    1.0,                     !- Upper Limit Value",
        "    CONTINUOUS;              !- Numeric Type",

        "  Schedule:Compact,",
        "    On,                      !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  Schedule:Compact,",
        "    Heating Setpoints,       !- Name",
        "    Temperature,             !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,21.0;       !- Field 3",

        "  Schedule:Compact,",
        "    Cooling Setpoints,       !- Name",
        "    Temperature,             !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,24.0;       !- Field 3",

        "  Schedule:Compact,",
        "    FanAndCoilAvailSched,    !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  ZoneHVAC:EquipmentConnections,",
        "    SPACE1-1,                !- Zone Name",
        "    Zone1Equipment,          !- Zone Conditioning Equipment List Name",
        "    Zone1Inlets,             !- Zone Air Inlet Node or NodeList Name",
        "    ,      !- Zone Air Exhaust Node or NodeList Name",
        "    Zone 1 Node,             !- Zone Air Node Name",
        "    Zone 1 Return Node;      !- Zone Return Air Node Name",

        "  ZoneHVAC:EquipmentList,",
        "    Zone1Equipment,          !- Name",
        "    SequentialLoad,          !- Load Distribution Scheme",
        "    ZoneHVAC:AirDistributionUnit,  !- Zone Equipment 1 Object Type",
        "    Zone1DirectAirADU,       !- Zone Equipment 1 Name",
        "    1,                       !- Zone Equipment 1 Cooling Sequence",
        "    1;                       !- Zone Equipment 1 Heating or No-Load Sequence",

        "  ZoneHVAC:AirDistributionUnit,",
        "    Zone1DirectAirADU,       !- Name",
        "    Zone 1 OA Inlet Node,    !- Air Distribution Unit Outlet Node Name",
        "    AirTerminal:SingleDuct:ConstantVolume:NoReheat,  !- Air Terminal Object Type",
        "    Zone1DirectAir;          !- Air Terminal Name",

        "  NodeList,",
        "    Zone1Inlets,             !- Name",
        "    Zone 1 OA Inlet Node;    !- Node 1 Name",

        "  Schedule:Compact,",
        "    CyclingFanSch,           !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.0;        !- Field 3",

        "  Material:NoMass,",
        "    R19LAYER,                !- Name",
        "    Rough,                   !- Roughness",
        "    3.344,                   !- Thermal Resistance {m2-K/W}",
        "    0.9000000,               !- Thermal Absorptance",
        "    0.7500000,               !- Solar Absorptance",
        "    0.7500000;               !- Visible Absorptance",

        "  Material,",
        "    C5 - 4 IN HW CONCRETE,   !- Name",
        "    MediumRough,             !- Roughness",
        "    0.1014984,               !- Thickness {m}",
        "    1.729577,                !- Conductivity {W/m-K}",
        "    2242.585,                !- Density {kg/m3}",
        "    836.8000,                !- Specific Heat {J/kg-K}",
        "    0.9000000,               !- Thermal Absorptance",
        "    0.6500000,               !- Solar Absorptance",
        "    0.6500000;               !- Visible Absorptance",

        "  Material,",
        "    1IN Stucco,              !- Name",
        "    Smooth,                  !- Roughness",
        "    0.0253,                  !- Thickness {m}",
        "    0.6918,                  !- Conductivity {W/m-K}",
        "    1858.0000,               !- Density {kg/m3}",
        "    837.0000,                !- Specific Heat {J/kg-K}",
        "    0.9000,                  !- Thermal Absorptance",
        "    0.9200,                  !- Solar Absorptance",
        "    0.9200;                  !- Visible Absorptance",

        "  Material,",
        "    8IN Concrete HW,         !- Name",
        "    MediumRough,             !- Roughness",
        "    0.2033,                  !- Thickness {m}",
        "    1.7296,                  !- Conductivity {W/m-K}",
        "    2243.0000,               !- Density {kg/m3}",
        "    837.0000,                !- Specific Heat {J/kg-K}",
        "    0.9000,                  !- Thermal Absorptance",
        "    0.6500,                  !- Solar Absorptance",
        "    0.6500;                  !- Visible Absorptance",

        "  Material,",
        "    Wall Insulation [5],     !- Name",
        "    MediumRough,             !- Roughness",
        "    0.0453,                  !- Thickness {m}",
        "    0.0432,                  !- Conductivity {W/m-K}",
        "    91.0000,                 !- Density {kg/m3}",
        "    837.0000,                !- Specific Heat {J/kg-K}",
        "    0.9000,                  !- Thermal Absorptance",
        "    0.5000,                  !- Solar Absorptance",
        "    0.5000;                  !- Visible Absorptance",

        "  Material,",
        "    1/2IN Gypsum,            !- Name",
        "    Smooth,                  !- Roughness",
        "    0.0127,                  !- Thickness {m}",
        "    0.1600,                  !- Conductivity {W/m-K}",
        "    784.9000,                !- Density {kg/m3}",
        "    830.0000,                !- Specific Heat {J/kg-K}",
        "    0.9000,                  !- Thermal Absorptance",
        "    0.9200,                  !- Solar Absorptance",
        "    0.9200;                  !- Visible Absorptance",

        "  Construction,",
        "    ext-walls,               !- Name",
        "    1IN Stucco,              !- Outside Layer",
        "    8IN Concrete HW,         !- Layer 2",
        "    Wall Insulation [5],     !- Layer 3",
        "    1/2IN Gypsum;            !- Layer 4",

        "  Construction,",
        "    FLOOR,                   !- Name",
        "    C5 - 4 IN HW CONCRETE;   !- Outside Layer",

        "  Construction,",
        "    ROOF19,                  !- Name",
        "    R19LAYER;                !- Outside Layer",

        "  Site:GroundTemperature:BuildingSurface,18.89,18.92,19.02,19.12,19.21,19.23,19.07,19.32,19.09,19.21,19.13,18.96;",

        "  Zone,",
        "    SPACE1-1,                !- Name",
        "    0.0000000E+00,           !- Direction of Relative North {deg}",
        "    0.0000000E+00,           !- X Origin {m}",
        "    0.0000000E+00,           !- Y Origin {m}",
        "    0.0000000E+00,           !- Z Origin {m}",
        "    1,                       !- Type",
        "    1,                       !- Multiplier",
        "    autocalculate,           !- Ceiling Height {m}",
        "    autocalculate;           !- Volume {m3}",

        "  GlobalGeometryRules,",
        "    UpperLeftCorner,         !- Starting Vertex Position",
        "    CounterClockWise,        !- Vertex Entry Direction",
        "    World;                   !- Coordinate System",

        "  BuildingSurface:Detailed,",
        "    Zn001:Wall001,           !- Name",
        "    Wall,                    !- Surface Type",
        "    ext-walls,               !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.5000000,               !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    0.0000000E+00,0.0000000E+00,4.572000,  !- X,Y,Z ==> Vertex 1 {m}",
        "    0.0000000E+00,0.0000000E+00,0.0000000E+00,  !- X,Y,Z ==> Vertex 2 {m}",
        "    15.24000,0.0000000E+00,0.0000000E+00,  !- X,Y,Z ==> Vertex 3 {m}",
        "    15.24000,0.0000000E+00,4.572000;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Wall002,           !- Name",
        "    Wall,                    !- Surface Type",
        "    ext-walls,               !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.5000000,               !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    15.24000,0.0000000E+00,4.572000,  !- X,Y,Z ==> Vertex 1 {m}",
        "    15.24000,0.0000000E+00,0.0000000E+00,  !- X,Y,Z ==> Vertex 2 {m}",
        "    15.24000,15.24000,0.0000000E+00,  !- X,Y,Z ==> Vertex 3 {m}",
        "    15.24000,15.24000,4.572000;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Wall003,           !- Name",
        "    Wall,                    !- Surface Type",
        "    ext-walls,               !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.5000000,               !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    15.24000,15.24000,4.572000,  !- X,Y,Z ==> Vertex 1 {m}",
        "    15.24000,15.24000,0.0000000E+00,  !- X,Y,Z ==> Vertex 2 {m}",
        "    0.0000000E+00,15.24000,0.0000000E+00,  !- X,Y,Z ==> Vertex 3 {m}",
        "    0.0000000E+00,15.24000,4.572000;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Wall004,           !- Name",
        "    Wall,                    !- Surface Type",
        "    ext-walls,               !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.5000000,               !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    0.0000000E+00,15.24000,4.572000,  !- X,Y,Z ==> Vertex 1 {m}",
        "    0.0000000E+00,15.24000,0.0000000E+00,  !- X,Y,Z ==> Vertex 2 {m}",
        "    0.0000000E+00,0.0000000E+00,0.0000000E+00,  !- X,Y,Z ==> Vertex 3 {m}",
        "    0.0000000E+00,0.0000000E+00,4.572000;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Flr001,            !- Name",
        "    Floor,                   !- Surface Type",
        "    FLOOR,                   !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Ground,                  !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    NoSun,                   !- Sun Exposure",
        "    NoWind,                  !- Wind Exposure",
        "    1.000000,                !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    15.24000,0.000000,0.0,  !- X,Y,Z ==> Vertex 1 {m}",
        "    0.000000,0.000000,0.0,  !- X,Y,Z ==> Vertex 2 {m}",
        "    0.000000,15.24000,0.0,  !- X,Y,Z ==> Vertex 3 {m}",
        "    15.24000,15.24000,0.0;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Roof001,           !- Name",
        "    Roof,                    !- Surface Type",
        "    ROOF19,                  !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.0000000E+00,           !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    0.000000,15.24000,4.572,  !- X,Y,Z ==> Vertex 1 {m}",
        "    0.000000,0.000000,4.572,  !- X,Y,Z ==> Vertex 2 {m}",
        "    15.24000,0.000000,4.572,  !- X,Y,Z ==> Vertex 3 {m}",
        "    15.24000,15.24000,4.572;  !- X,Y,Z ==> Vertex 4 {m}",

        "  Sizing:Plant,",
        "    Hot Water Loop,          !- Plant or Condenser Loop Name",
        "    heating,                 !- Loop Type",
        "    82.,                     !- Design Loop Exit Temperature {C}",
        "    11;                      !- Loop Design Temperature Difference {deltaC}",

        "  PlantLoop,",
        "    Hot Water Loop,          !- Name",
        "    Water,                   !- Fluid Type",
        "    ,                        !- User Defined Fluid Type",
        "    Hot Loop Operation,      !- Plant Equipment Operation Scheme Name",
        "    HW Supply Outlet Node,   !- Loop Temperature Setpoint Node Name",
        "    100,                     !- Maximum Loop Temperature {C}",
        "    10,                      !- Minimum Loop Temperature {C}",
        "    Autosize,                !- Maximum Loop Flow Rate {m3/s}",
        "    0.0,                     !- Minimum Loop Flow Rate {m3/s}",
        "    autocalculate,           !- Plant Loop Volume {m3}",
        "    HW Supply Inlet Node,    !- Plant Side Inlet Node Name",
        "    HW Supply Outlet Node,   !- Plant Side Outlet Node Name",
        "    Heating Supply Side Branches,  !- Plant Side Branch List Name",
        "    Heating Supply Side Connectors,  !- Plant Side Connector List Name",
        "    HW Demand Inlet Node,    !- Demand Side Inlet Node Name",
        "    HW Demand Outlet Node,   !- Demand Side Outlet Node Name",
        "    Heating Demand Side Branches,  !- Demand Side Branch List Name",
        "    Heating Demand Side Connectors,  !- Demand Side Connector List Name",
        "    Optimal,                 !- Load Distribution Scheme",
        "    ,                        !- Availability Manager List Name",
        "    ,                        !- Plant Loop Demand Calculation Scheme",
        "    ,                        !- Common Pipe Simulation",
        "    ,                        !- Pressure Simulation Type",
        "    ;                        !- Loop Circulation Time",

        "  SetpointManager:Scheduled,",
        "    Hot Water Loop Setpoint Manager,  !- Name",
        "    Temperature,             !- Control Variable",
        "    HW Loop Temp Schedule,   !- Schedule Name",
        "    Hot Water Loop Setpoint Node List;  !- Setpoint Node or NodeList Name",

        "  Schedule:Compact,",
        "    HW LOOP TEMP SCHEDULE,   !- Name",
        "    TEMPERATURE,             !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: Alldays,            !- Field 2",
        "    Until: 24:00,82.0;       !- Field 3",

        "  NodeList,",
        "    Hot Water Loop Setpoint Node List,  !- Name",
        "    HW Supply Outlet Node;   !- Node 1 Name",

        "  BranchList,",
        "    Heating Supply Side Branches,  !- Name",
        "    Heating Supply Inlet Branch,  !- Branch 1 Name",
        "    Heating Purchased Hot Water Branch,  !- Branch 2 Name",
        "    Heating Supply Bypass Branch,  !- Branch 3 Name",
        "    Heating Supply Outlet Branch;  !- Branch 4 Name",

        "  ConnectorList,",
        "    Heating Supply Side Connectors,  !- Name",
        "    Connector:Splitter,      !- Connector 1 Object Type",
        "    Heating Supply Splitter, !- Connector 1 Name",
        "    Connector:Mixer,         !- Connector 2 Object Type",
        "    Heating Supply Mixer;    !- Connector 2 Name",

        "  Connector:Splitter,",
        "    Heating Supply Splitter, !- Name",
        "    Heating Supply Inlet Branch,  !- Inlet Branch Name",
        "    Heating Purchased Hot Water Branch,  !- Outlet Branch 1 Name",
        "    Heating Supply Bypass Branch;  !- Outlet Branch 2 Name",

        "  Connector:Mixer,",
        "    Heating Supply Mixer,    !- Name",
        "    Heating Supply Outlet Branch,  !- Outlet Branch Name",
        "    Heating Purchased Hot Water Branch,  !- Inlet Branch 1 Name",
        "    Heating Supply Bypass Branch;  !- Inlet Branch 2 Name",

        "  Branch,",
        "    Heating Supply Inlet Branch,  !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pump:VariableSpeed,      !- Component 1 Object Type",
        "    HW Circ Pump,            !- Component 1 Name",
        "    HW Supply Inlet Node,    !- Component 1 Inlet Node Name",
        "    HW Pump Outlet Node;     !- Component 1 Outlet Node Name",

        "  Branch,",
        "    Heating Purchased Hot Water Branch,  !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    DistrictHeating:Water,         !- Component 1 Object Type",
        "    Purchased Heating,       !- Component 1 Name",
        "    Purchased Heat Inlet Node,  !- Component 1 Inlet Node Name",
        "    Purchased Heat Outlet Node;  !- Component 1 Outlet Node Name",

        "  Branch,",
        "    Heating Supply Bypass Branch,  !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    Heating Supply Side Bypass,  !- Component 1 Name",
        "    Heating Supply Bypass Inlet Node,  !- Component 1 Inlet Node Name",
        "    Heating Supply Bypass Outlet Node;  !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    Heating Supply Side Bypass,  !- Name",
        "    Heating Supply Bypass Inlet Node,  !- Inlet Node Name",
        "    Heating Supply Bypass Outlet Node;  !- Outlet Node Name",

        "  Branch,",
        "    Heating Supply Outlet Branch,  !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    Heating Supply Outlet,   !- Component 1 Name",
        "    Heating Supply Exit Pipe Inlet Node,  !- Component 1 Inlet Node Name",
        "    HW Supply Outlet Node;   !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    Heating Supply Outlet,   !- Name",
        "    Heating Supply Exit Pipe Inlet Node,  !- Inlet Node Name",
        "    HW Supply Outlet Node;   !- Outlet Node Name",

        "  Pump:VariableSpeed,",
        "    HW Circ Pump,            !- Name",
        "    HW Supply Inlet Node,    !- Inlet Node Name",
        "    HW Pump Outlet Node,     !- Outlet Node Name",
        "    autosize,                !- Design Maximum Flow Rate {m3/s}",
        "    179352,                  !- Design Pump Head {Pa}",
        "    autosize,                !- Design Power Consumption {W}",
        "    0.9,                     !- Motor Efficiency",
        "    0.0,                     !- Fraction of Motor Inefficiencies to Fluid Stream",
        "    0,                       !- Coefficient 1 of the Part Load Performance Curve",
        "    1,                       !- Coefficient 2 of the Part Load Performance Curve",
        "    0,                       !- Coefficient 3 of the Part Load Performance Curve",
        "    0,                       !- Coefficient 4 of the Part Load Performance Curve",
        "    0,                       !- Design Minimum Flow Rate {m3/s}",
        "    INTERMITTENT;            !- Pump Control Type",

        "  BranchList,",
        "    Heating Demand Side Branches,  !- Name",
        "    ZonesHWInletBranch,      !- Branch 1 Name",
        "    Zone1HWBranch,           !- Branch 2 Name",
        "    ZonesHWBypassBranch,     !- Branch 5 Name",
        "    ZonesHWOutletBranch;     !- Branch 6 Name",

        "  ConnectorList,",
        "    Heating Demand Side Connectors,  !- Name",
        "    Connector:Splitter,      !- Connector 1 Object Type",
        "    Zones HW Splitter,       !- Connector 1 Name",
        "    Connector:Mixer,         !- Connector 2 Object Type",
        "    Zones HW Mixer;          !- Connector 2 Name",

        "  Connector:Splitter,",
        "    Zones HW Splitter,       !- Name",
        "    ZonesHWInletBranch,      !- Inlet Branch Name",
        "    Zone1HWBranch,           !- Outlet Branch 1 Name",
        "    ZonesHWBypassBranch;     !- Outlet Branch 4 Name",

        "  Connector:Mixer,",
        "    Zones HW Mixer,          !- Name",
        "    ZonesHWOutletBranch,     !- Outlet Branch Name",
        "    Zone1HWBranch,           !- Inlet Branch 1 Name",
        "    ZonesHWBypassBranch;     !- Inlet Branch 4 Name",

        "  Branch,",
        "    ZonesHWInletBranch,      !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    ZonesHWInletPipe,        !- Component 1 Name",
        "    HW Demand Inlet Node,    !- Component 1 Inlet Node Name",
        "    HW Demand Entrance Pipe Outlet Node;  !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    ZonesHWInletPipe,        !- Name",
        "    HW Demand Inlet Node,    !- Inlet Node Name",
        "    HW Demand Entrance Pipe Outlet Node;  !- Outlet Node Name",

        "  Branch,",
        "    ZonesHWOutletBranch,     !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    ZonesHWOutletPipe,       !- Component 1 Name",
        "    HW Demand Exit Pipe Inlet Node,  !- Component 1 Inlet Node Name",
        "    HW Demand Outlet Node;   !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    ZonesHWOutletPipe,       !- Name",
        "    HW Demand Exit Pipe Inlet Node,  !- Inlet Node Name",
        "    HW Demand Outlet Node;   !- Outlet Node Name",

        "  Branch,",
        "    Zone1HWBranch,           !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Coil:Heating:Water,      !- Component 1 Object Type",
        "    OA Preheat HW Coil,      !- Component 1 Name",
        "    HWCoil Water InletNode,  !- Component 1 Inlet Node Name",
        "    HWCoil Water OutletNode; !- Zone1UnitHeatHWOutletNode;  !- Component 1 Outlet Node Name",

        "  Branch,",
        "    ZonesHWBypassBranch,     !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    ZonesHWBypassPipe,       !- Component 1 Name",
        "    ZonesHWBypassInletNode,  !- Component 1 Inlet Node Name",
        "    ZonesHWBypassOutletNode; !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    ZonesHWBypassPipe,       !- Name",
        "    ZonesHWBypassInletNode,  !- Inlet Node Name",
        "    ZonesHWBypassOutletNode; !- Outlet Node Name",

        "  PlantEquipmentOperationSchemes,",
        "    Hot Loop Operation,      !- Name",
        "    PlantEquipmentOperation:HeatingLoad,  !- Control Scheme 1 Object Type",
        "    Purchased Heating Only,  !- Control Scheme 1 Name",
        "    ON;                      !- Control Scheme 1 Schedule Name",

        "  PlantEquipmentOperation:HeatingLoad,",
        "    Purchased Heating Only,  !- Name",
        "    0,                       !- Load Range 1 Lower Limit {W}",
        "    1000000,                 !- Load Range 1 Upper Limit {W}",
        "    heating plant;           !- Range 1 Equipment List Name",

        "  PlantEquipmentList,",
        "    heating plant,           !- Name",
        "    DistrictHeating:Water,         !- Equipment 1 Object Type",
        "    Purchased Heating;       !- Equipment 1 Name",

        "  DistrictHeating:Water,",
        "    Purchased Heating,       !- Name",
        "    Purchased Heat Inlet Node,  !- Hot Water Inlet Node Name",
        "    Purchased Heat Outlet Node,  !- Hot Water Outlet Node Name",
        "    1000000;                 !- Nominal Capacity {W}",

        "  Coil:Heating:Water,",
        "    OA Preheat HW Coil,      !- Name",
        "    CoilSchedOff,            !- Availability Schedule Name",
        "    autosize,                !- U-Factor Times Area Value {W/K}",
        "    autosize,                !- Maximum Water Flow Rate {m3/s}",
        "    HWCoil Water InletNode,  !- Zone1UnitHeatHWInletNode,!- Water Inlet Node Name",
        "    HWCoil Water OutletNode, !- Water Outlet Node Name",
        "    Outside Air Inlet Node,  !- Air Inlet Node Name",
        "    HW Coil Air OutletNode,  !- Air Outlet Node Name",
        "    UFactorTimesAreaAndDesignWaterFlowRate,  !- Performance Input Method",
        "    autosize,                !- Rated Capacity {W}",
        "    82.2,                    !- Rated Inlet Water Temperature {C}",
        "    16.6,                    !- Rated Inlet Air Temperature {C}",
        "    71.1,                    !- Rated Outlet Water Temperature {C}",
        "    32.2,                    !- Rated Outlet Air Temperature {C}",
        "    ;                        !- Rated Ratio for Air and Water Convection",

        "  Schedule:Compact,",
        "    CoilSchedOff,            !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.0;        !- Field 3",
    });
    ASSERT_TRUE(process_idf(idf_objects));

    // OutputProcessor::TimeValue.allocate(2);
    SimulationManager::ManageSimulation(*state);

    EXPECT_EQ(1, state->dataAirLoop->NumOASystems);
    EXPECT_EQ("OA SYS 1", state->dataAirLoop->OutsideAirSys(OASysNum).Name);
    EXPECT_EQ(2, state->dataAirLoop->OutsideAirSys(OASysNum).NumComponents);                       // there are two components in OA system
    EXPECT_EQ("OA PREHEAT HW COIL", state->dataAirLoop->OutsideAirSys(OASysNum).ComponentName(1)); // pre heat hot water coil
    EXPECT_EQ(state->dataWaterCoils->WaterCoil(1).Name, state->dataAirLoop->OutsideAirSys(OASysNum).ComponentName(1)); // pre heat hot water coil
    EXPECT_EQ("OA MIXING BOX", state->dataAirLoop->OutsideAirSys(OASysNum).ComponentName(2));                          // OA mixer

    // simulate the outdoor air system
    ManageOutsideAirSystem(*state, state->dataAirLoop->OutsideAirSys(OASysNum).Name, false, AirLoopNum, OASysNum);

    // Hot water coil is scheduled off, inlet and outlet conditions are the same
    EXPECT_DOUBLE_EQ(state->dataWaterCoils->WaterCoil(1).InletAirTemp,
                     -17.3); // preheat Hot Water coil air inlet temp is the heating design day outdoor air temp
    EXPECT_DOUBLE_EQ(state->dataWaterCoils->WaterCoil(1).OutletAirTemp, -17.3);         // preheat Hot Water coil is scheduled off
    EXPECT_DOUBLE_EQ(0.0, state->dataWaterCoils->WaterCoil(1).TotWaterHeatingCoilRate); // preheat Hot Water coil is scheduled off
}

TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOnSim)
{

    int AirLoopNum(1);
    int OASysNum(1);
    int AirInletNodeNum(0);
    Real64 CpAir(0.0);

    std::string const idf_objects = delimited_string({
        "  Timestep, 4;",

        "  SimulationControl,",
        "    Yes,                     !- Do Zone Sizing Calculation",
        "    Yes,                     !- Do System Sizing Calculation",
        "    No,                      !- Do Plant Sizing Calculation",
        "    Yes,                     !- Run Simulation for Sizing Periods",
        "    No;                      !- Run Simulation for Weather File Run Periods",

        "  RunPeriod,",
        "    RP1,                     !- Name",
        "    1,                       !- Begin Month",
        "    1,                       !- Begin Day of Month",
        "    ,                        !- Begin Year",
        "    12,                      !- End Month",
        "    31,                      !- End Day of Month",
        "    ,                        !- End Year",
        "    Tuesday,                 !- Day of Week for Start Day",
        "    Yes,                     !- Use Weather File Holidays and Special Days",
        "    Yes,                     !- Use Weather File Daylight Saving Period",
        "    No,                      !- Apply Weekend Holiday Rule",
        "    Yes,                     !- Use Weather File Rain Indicators",
        "    Yes;                     !- Use Weather File Snow Indicators",

        "  Site:Location,",
        "    CHICAGO_IL_USA TMY2-94846,  !- Name",
        "    41.78,                   !- Latitude {deg}",
        "    -87.75,                  !- Longitude {deg}",
        "    -6.00,                   !- Time Zone {hr}",
        "    190.00;                  !- Elevation {m}",

        "  SizingPeriod:DesignDay,",
        "    CHICAGO_IL_USA Annual Heating 99% Design Conditions DB,  !- Name",
        "    1,                       !- Month",
        "    21,                      !- Day of Month",
        "    WinterDesignDay,         !- Day Type",
        "    -17.3,                   !- Maximum Dry-Bulb Temperature {C}",
        "    0.0,                     !- Daily Dry-Bulb Temperature Range {deltaC}",
        "    ,                        !- Dry-Bulb Temperature Range Modifier Type",
        "    ,                        !- Dry-Bulb Temperature Range Modifier Day Schedule Name",
        "    Wetbulb,                 !- Humidity Condition Type",
        "    -17.3,                   !- Wetbulb or DewPoint at Maximum Dry-Bulb {C}",
        "    ,                        !- Humidity Condition Day Schedule Name",
        "    ,                        !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir}",
        "    ,                        !- Enthalpy at Maximum Dry-Bulb {J/kg}",
        "    ,                        !- Daily Wet-Bulb Temperature Range {deltaC}",
        "    99063.,                  !- Barometric Pressure {Pa}",
        "    4.9,                     !- Wind Speed {m/s}",
        "    270,                     !- Wind Direction {deg}",
        "    No,                      !- Rain Indicator",
        "    No,                      !- Snow Indicator",
        "    No,                      !- Daylight Saving Time Indicator",
        "    ASHRAEClearSky,          !- Solar Model Indicator",
        "    ,                        !- Beam Solar Day Schedule Name",
        "    ,                        !- Diffuse Solar Day Schedule Name",
        "    ,                        !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless}",
        "    ,                        !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless}",
        "    0.0;                     !- Sky Clearness",

        "  BranchList,",
        "    Air Loop Branches,       !- Name",
        "    Air Loop Main Branch;    !- Branch 1 Name",

        "  Branch,",
        "    Air Loop Main Branch,    !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    AirLoopHVAC:OutdoorAirSystem,  !- Component 1 Object Type",
        "    OA Sys 1,                !- Component 1 Name",
        "    Outdoor Air Mixer Inlet Node,  !- Component 1 Inlet Node Name",
        "    Mixed Air Node,          !- Component 1 Outlet Node Name",
        "    Fan:ConstantVolume,      !- Component 2 Object Type",
        "    Supply Fan 1,            !- Component 2 Name",
        "    Mixed Air Node,          !- Component 2 Inlet Node Name",
        "    Air Loop Outlet Node;    !- Component 2 Outlet Node Name",

        "  AirLoopHVAC,",
        "    DOAS,                    !- Name",
        "    ,                        !- Controller List Name",
        "    Outdoor Air 1 Avail List,!- Availability Manager List Name",
        "    0.0625,                  !- Design Supply Air Flow Rate {m3/s}",
        "    Air Loop Branches,       !- Branch List Name",
        "    ,                        !- Connector List Name",
        "    Outdoor Air Mixer Inlet Node,  !- Supply Side Inlet Node Name",
        "    Return Air Mixer Outlet, !- Demand Side Outlet Node Name",
        "    Zone Equipment Inlet Node,  !- Demand Side Inlet Node Names",
        "    Air Loop Outlet Node;    !- Supply Side Outlet Node Names",

        "  AirLoopHVAC:SupplyPath,",
        "    OASysSupplyPath,         !- Name",
        "    Zone Equipment Inlet Node,  !- Supply Air Path Inlet Node Name",
        "    AirLoopHVAC:ZoneSplitter,!- Component 1 Object Type",
        "    Zone Supply Air Splitter;!- Component 1 Name",

        "  AirLoopHVAC:ReturnPath,",
        "    OASysReturnPath,         !- Name",
        "    Return Air Mixer Outlet, !- Return Air Path Outlet Node Name",
        "    AirLoopHVAC:ZoneMixer,   !- Component 1 Object Type",
        "    Zone Return Air Mixer;   !- Component 1 Name",

        "  AirLoopHVAC:ZoneSplitter,",
        "    Zone Supply Air Splitter,!- Name",
        "    Zone Equipment Inlet Node,  !- Inlet Node Name",
        "    Zone 1 OA Inlet Node 2AT;    !- Outlet 1 Node Name",

        "  AirLoopHVAC:ZoneMixer,",
        "    Zone Return Air Mixer,   !- Name",
        "    Return Air Mixer Outlet, !- Outlet Node Name",
        "    Zone 1 Return Node;      !- Inlet 1 Node Name",

        "  AirLoopHVAC:ControllerList,",
        "    OA Sys 1 Controllers,    !- Name",
        "    Controller:OutdoorAir,   !- Controller 1 Object Type",
        "    OA Controller 1,         !- Controller 1 Name",
        "    Controller:WaterCoil,    !- Controller 2 Object Type",
        "    Preheat Coil Controller; !- Controller 2 Name",

        "  Controller:WaterCoil,",
        "    Preheat Coil Controller, !- Name",
        "    Temperature,             !- Control Variable",
        "    Normal,                  !- Action",
        "    Flow,                    !- Actuator Variable",
        "    HW Coil Air OutletNode,  !- Sensor Node Name",
        "    HWCoil Water InletNode,  !- Actuator Node Name",
        "    Autosize,                !- Controller Convergence Tolerance {deltaC}",
        "    Autosize,                !- Maximum Actuated Flow {m3/s}",
        "    0;                       !- Minimum Actuated Flow {m3/s}",

        "  AirLoopHVAC:OutdoorAirSystem:EquipmentList,",
        "    OA Sys 1 Equipment,      !- Name",
        "    Coil:Heating:Water,      !- Component 1 Object Type",
        "    OA Preheat HW Coil,      !- Component 1 Name",
        "    OutdoorAir:Mixer,        !- Component 1 Object Type",
        "    OA Mixing Box;           !- Component 1 Name",

        "  AirLoopHVAC:OutdoorAirSystem,",
        "    OA Sys 1,                !- Name",
        "    OA Sys 1 Controllers,    !- Controller List Name",
        "    OA Sys 1 Equipment;      !- Outdoor Air Equipment List Name",

        "  OutdoorAir:NodeList,",
        "    OUTSIDE AIR INLET NODE;    !- Node or NodeList Name 1",

        "  OutdoorAir:Mixer,",
        "    OA Mixing Box,           !- Name",
        "    Mixed Air Node,          !- Mixed Air Node Name",
        "    HW Coil Air OutletNode,  !- Outdoor Air Stream Node Name",
        "    Relief Air Outlet Node,  !- Relief Air Stream Node Name",
        "    Outdoor Air Mixer Inlet Node;  !- Return Air Stream Node Name",

        "  AvailabilityManagerAssignmentList,",
        "    Outdoor Air 1 Avail List,!- Name",
        "    AvailabilityManager:Scheduled,  !- Availability Manager 1 Object Type",
        "    Outdoor Air 1 Avail;     !- Availability Manager 1 Name",

        "  AvailabilityManager:Scheduled,",
        "    Outdoor Air 1 Avail,     !- Name",
        "    FanAndCoilAvailSched;    !- Schedule Name",

        "  SetpointManager:MixedAir,",
        "    Mixed Air Temp Manager 1,!- Name",
        "    Temperature,             !- Control Variable",
        "    Air Loop Outlet Node,    !- Reference Setpoint Node Name",
        "    Mixed Air Node,          !- Fan Inlet Node Name",
        "    Air Loop Outlet Node,    !- Fan Outlet Node Name",
        "    Mixed Air Node;          !- Setpoint Node or NodeList Name",

        "  SetpointManager:Scheduled,",
        "    HW Coil Air Temp Manager,!- Name",
        "    Temperature,             !- Control Variable",
        "    Schedule_Constant_11.6,  !- Schedule Name",
        "    HW Coil Air OutletNode;  !- Setpoint Node or NodeList Name",

        "  Schedule:Constant,Schedule_Constant_11.6, Temperature, 11.6;",

        "  Controller:OutdoorAir,",
        "    OA Controller 1,         !- Name",
        "    Relief Air Outlet Node,  !- Relief Air Outlet Node Name",
        "    Outdoor Air Mixer Inlet Node,  !- Return Air Node Name",
        "    Mixed Air Node,          !- Mixed Air Node Name",
        "    Outside Air Inlet Node,  !- Actuator Node Name",
        "    0.0625,                  !- Minimum Outdoor Air Flow Rate {m3/s}",
        "    0.0625,                  !- Maximum Outdoor Air Flow Rate {m3/s}",
        "    DifferentialDrybulb,     !- Economizer Control Type",
        "    ModulateFlow,            !- Economizer Control Action Type",
        "    23.,                     !- Economizer Maximum Limit Dry-Bulb Temperature {C}",
        "    ,                        !- Economizer Maximum Limit Enthalpy {J/kg}",
        "    13.5,                    !- Economizer Maximum Limit Dewpoint Temperature {C}",
        "    ,                        !- Electronic Enthalpy Limit Curve Name",
        "    14.,                     !- Economizer Minimum Limit Dry-Bulb Temperature {C}",
        "    NoLockout,               !- Lockout Type",
        "    FixedMinimum,            !- Minimum Limit Type",
        "    OAFractionSched,         !- Minimum Outdoor Air Schedule Name",
        "    ,                        !- Minimum Fraction of Outdoor Air Schedule Name",
        "    ,                        !- Maximum Fraction of Outdoor Air Schedule Name",
        "    ;                        !- Mechanical Ventilation Controller Name",

        "  Fan:ConstantVolume,",
        "    Supply Fan 1,            !- Name",
        "    FanAndCoilAvailSched,    !- Availability Schedule Name",
        "    0.7,                     !- Fan Total Efficiency",
        "    600.0,                   !- Pressure Rise {Pa}",
        "    0.0625,                  !- Maximum Flow Rate {m3/s}",
        "    0.9,                     !- Motor Efficiency",
        "    1.0,                     !- Motor In Airstream Fraction",
        "    Mixed Air Node,          !- Air Inlet Node Name",
        "    Air Loop Outlet Node;    !- Air Outlet Node Name",

        "  AirTerminal:SingleDuct:ConstantVolume:NoReheat,",
        "    Zone1DirectAir,          !- Name",
        "    FanAndCoilAvailSched,    !- Availability Schedule Name",
        "    Zone 1 OA Inlet Node 2AT,   !- Air Inlet Node Name",
        "    Zone 1 OA Inlet Node,       !- Air Outlet Node Name",
        "    0.0625;                   !- Maximum Air Flow Rate {m3/s}",

        "  Schedule:Compact,",
        "    OAFractionSched,         !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.5;        !- Field 3",

        "  SetpointManager:SingleZone:Reheat,",
        "    Supply Air Temp Manager, !- Name",
        "    Temperature,             !- Control Variable",
        "    14.0,                    !- Minimum Supply Air Temperature {C}",
        "    40.0,                    !- Maximum Supply Air Temperature {C}",
        "    SPACE1-1,                !- Control Zone Name",
        "    Zone 1 Node,             !- Zone Node Name",
        "    Zone 1 OA Inlet Node,    !- Zone Inlet Node Name",
        "    Air Loop Outlet Node;    !- Setpoint Node or NodeList Name",

        "  Sizing:System,",
        "    DOAS,                    !- AirLoop Name",
        "    Sensible,                !- Type of Load to Size On",
        "    autosize,                !- Design Outdoor Air Flow Rate {m3/s}",
        "    1.0,                     !- Central Heating Maximum System Air Flow Ratio",
        "    40.0,                    !- Preheat Design Temperature {C}",
        "    0.008,                   !- Preheat Design Humidity Ratio {kgWater/kgDryAir}",
        "    15.56,                   !- Precool Design Temperature {C}",
        "    0.008,                   !- Precool Design Humidity Ratio {kgWater/kgDryAir}",
        "    12.78,                   !- Central Cooling Design Supply Air Temperature {C}",
        "    12.78,                   !- Central Heating Design Supply Air Temperature {C}",
        "    NonCoincident,           !- Type of Zone Sum to Use",
        "    No,                      !- 100% Outdoor Air in Cooling",
        "    No,                      !- 100% Outdoor Air in Heating",
        "    0.0085,                  !- Central Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir}",
        "    0.008,                   !- Central Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir}",
        "    Flow/System,             !- Cooling Supply Air Flow Rate Method",
        "    8.287,                   !- Cooling Supply Air Flow Rate {m3/s}",
        "    0.0099676501,            !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2}",
        "    1,                       !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate",
        "    3.9475456e-005,          !- Cooling Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}",
        "    Flow/System,             !- Heating Supply Air Flow Rate Method",
        "    0.338942175,             !- Heating Supply Air Flow Rate {m3/s}",
        "    0.0099676501,            !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2}",
        "    1,                       !- Heating Fraction of Autosized Heating Supply Air Flow Rate",
        "    1,                       !- Heating Fraction of Autosized Cooling Supply Air Flow Rate",
        "    3.1588213e-005,          !- Heating Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}",
        "    ZoneSum,                 !- System Outdoor Air Method",
        "    1,                       !- Zone Maximum Outdoor Air Fraction {dimensionless}",
        "    CoolingDesignCapacity,   !- Cooling Design Capacity Method",
        "    Autosize,                !- Cooling Design Capacity {W}",
        "    234.7,                   !- Cooling Design Capacity Per Floor Area {W/m2}",
        "    1,                       !- Fraction of Autosized Cooling Design Capacity",
        "    HeatingDesignCapacity,   !- Heating Design Capacity Method",
        "    Autosize,                !- Heating Design Capacity {W}",
        "    157,                     !- Heating Design Capacity Per Floor Area {W/m2}",
        "    1,                       !- Fraction of Autosized Heating Design Capacity",
        "    VAV;                     !- Central Cooling Capacity Control Method",
        "	",

        "  Site:GroundTemperature:Deep,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5,16.5;",

        "  Sizing:Parameters,",
        "    1.3,                     !- Heating Sizing Factor",
        "    1.3,                     !- Cooling Sizing Factor",
        "    ;                        !- Timesteps in Averaging Window",

        "  Sizing:Zone,",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    SupplyAirTemperature,    !- Zone Cooling Design Supply Air Temperature Input Method",
        "    13.,                     !- Zone Cooling Design Supply Air Temperature {C}",
        "    ,                        !- Zone Cooling Design Supply Air Temperature Difference {deltaC}",
        "    SupplyAirTemperature,    !- Zone Heating Design Supply Air Temperature Input Method",
        "    30.,                     !- Zone Heating Design Supply Air Temperature {C}",
        "    ,                        !- Zone Heating Design Supply Air Temperature Difference {deltaC}",
        "    0.0075,                  !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir}",
        "    0.004,                   !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir}",
        "    SZ DSOA SPACE1-1,        !- Design Specification Outdoor Air Object Name",
        "    0.0,                     !- Zone Heating Sizing Factor",
        "    0.0,                     !- Zone Cooling Sizing Factor",
        "    DesignDay,               !- Cooling Design Air Flow Method",
        "    0,                       !- Cooling Design Air Flow Rate {m3/s}",
        "    ,                        !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2}",
        "    ,                        !- Cooling Minimum Air Flow {m3/s}",
        "    ,                        !- Cooling Minimum Air Flow Fraction",
        "    DesignDay,               !- Heating Design Air Flow Method",
        "    0,                       !- Heating Design Air Flow Rate {m3/s}",
        "    ,                        !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2}",
        "    ,                        !- Heating Maximum Air Flow {m3/s}",
        "    ;                        !- Heating Maximum Air Flow Fraction",

        "  DesignSpecification:OutdoorAir,",
        "    SZ DSOA SPACE1-1,        !- Name",
        "    flow/person,             !- Outdoor Air Method",
        "    0.0125,                  !- Outdoor Air Flow per Person {m3/s-person}",
        "    0.0,                     !- Outdoor Air Flow per Zone Floor Area {m3/s-m2}",
        "    0.0;                     !- Outdoor Air Flow per Zone {m3/s}",

        "  People,",
        "    SPACE1-1 PEOPLE,         !- Name",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    OFFICE OCCUPANCY,        !- Number of People Schedule Name",
        "    people,                  !- Number of People Calculation Method",
        "    5.000000,                !- Number of People",
        "    ,                        !- People per Zone Floor Area {person/m2}",
        "    ,                        !- Zone Floor Area per Person {m2/person}",
        "    0.3000000,               !- Fraction Radiant",
        "    ,                        !- Sensible Heat Fraction",
        "    Activity Sch,            !- Activity Level Schedule Name",
        "    3.82E-8,                 !- Carbon Dioxide Generation Rate {m3/s-W}",
        "    ,                        !- Enable ASHRAE 55 Comfort Warnings",
        "    EnclosureAveraged,            !- Mean Radiant Temperature Calculation Type",
        "    ,                        !- Surface Name/Angle Factor List Name",
        "    Work Eff Sch,            !- Work Efficiency Schedule Name",
        "    ClothingInsulationSchedule,  !- Clothing Insulation Calculation Method",
        "    ,                        !- Clothing Insulation Calculation Method Schedule Name",
        "    Clothing Sch,            !- Clothing Insulation Schedule Name",
        "    Air Velo Sch,            !- Air Velocity Schedule Name",
        "    FANGER;                  !- Thermal Comfort Model 1 Type",

        "  Schedule:Compact,",
        "    OFFICE OCCUPANCY,        !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 21",
        "    Until: 24:00,1.0;        !- Field 22",

        "  Schedule:Compact,",
        "    Activity Sch,            !- Name",
        "    Any Number,              !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,131.8;      !- Field 3",

        "  Schedule:Compact,",
        "    Work Eff Sch,            !- Name",
        "    Any Number,              !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.0;        !- Field 3",

        "  Schedule:Compact,",
        "    Clothing Sch,            !- Name",
        "    Any Number,              !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  Schedule:Compact,",
        "    Air Velo Sch,            !- Name",
        "    Any Number,              !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.137;      !- Field 3",

        "  Schedule:Compact,",
        "    BLDG_EQUIP_SCH,          !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  ScheduleTypeLimits,",
        "    Any Number;              !- Name",

        "  Lights,",
        "    SPACE1-1 Lights,         !- Name",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    LIGHTS-1,                !- Schedule Name",
        "    LightingLevel,           !- Design Level Calculation Method",
        "    284,                     !- Lighting Level {W}",
        "    ,                        !- Watts per Zone Floor Area {W/m2}",
        "    ,                        !- Watts per Person {W/person}",
        "    0.0,                     !- Return Air Fraction",
        "    0.59,                    !- Fraction Radiant",
        "    0.2,                     !- Fraction Visible",
        "    0,                       !- Fraction Replaceable",
        "    GeneralLights;           !- End-Use Subcategory",

        "  ElectricEquipment,",
        "    SPACE1-1_MiscPlug_Equip, !- Name",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    BLDG_EQUIP_SCH,          !- Schedule Name",
        "    EquipmentLevel,          !- Design Level Calculation Method",
        "    207.7352,                !- Design Level {W}",
        "    ,                        !- Watts per Zone Floor Area {W/m2}",
        "    ,                        !- Watts per Person {W/person}",
        "    0.0000,                  !- Fraction Latent",
        "    0.5000,                  !- Fraction Radiant",
        "    0.0000,                  !- Fraction Lost",
        "    MiscPlug;                !- End-Use Subcategory",

        "  Schedule:Compact,",
        "    LIGHTS-1,                !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  ZoneControl:Thermostat,",
        "    Zone 1 Thermostat,       !- Name",
        "    SPACE1-1,                !- Zone or ZoneList Name",
        "    Zone Control Type Sched, !- Control Type Schedule Name",
        "    ThermostatSetpoint:DualSetpoint,  !- Control 1 Object Type",
        "    Temperature Setpoints;   !- Control 1 Name",

        "  ThermostatSetpoint:DualSetpoint,",
        "    Temperature Setpoints,   !- Name",
        "    Heating Setpoints,       !- Heating Setpoint Temperature Schedule Name",
        "    Cooling Setpoints;       !- Cooling Setpoint Temperature Schedule Name",

        "  Schedule:Compact,",
        "    Zone Control Type Sched, !- Name",
        "    Control Type,            !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,4;          !- Field 3",

        "  ScheduleTypeLimits,",
        "    Control Type,            !- Name",
        "    0,                       !- Lower Limit Value",
        "    4,                       !- Upper Limit Value",
        "    DISCRETE;                !- Numeric Type",

        "  ScheduleTypeLimits,",
        "    Temperature,             !- Name",
        "    -60,                     !- Lower Limit Value",
        "    200,                     !- Upper Limit Value",
        "    CONTINUOUS,              !- Numeric Type",
        "    Temperature;             !- Unit Type",

        "  ScheduleTypeLimits,",
        "    Fraction,                !- Name",
        "    0.0,                     !- Lower Limit Value",
        "    1.0,                     !- Upper Limit Value",
        "    CONTINUOUS;              !- Numeric Type",

        "  Schedule:Compact,",
        "    On,                      !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  Schedule:Compact,",
        "    Heating Setpoints,       !- Name",
        "    Temperature,             !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,21.0;       !- Field 3",

        "  Schedule:Compact,",
        "    Cooling Setpoints,       !- Name",
        "    Temperature,             !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,24.0;       !- Field 3",

        "  Schedule:Compact,",
        "    FanAndCoilAvailSched,    !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,1.0;        !- Field 3",

        "  ZoneHVAC:EquipmentConnections,",
        "    SPACE1-1,                !- Zone Name",
        "    Zone1Equipment,          !- Zone Conditioning Equipment List Name",
        "    Zone1Inlets,             !- Zone Air Inlet Node or NodeList Name",
        "    ,      !- Zone Air Exhaust Node or NodeList Name",
        "    Zone 1 Node,             !- Zone Air Node Name",
        "    Zone 1 Return Node;      !- Zone Return Air Node Name",

        "  ZoneHVAC:EquipmentList,",
        "    Zone1Equipment,          !- Name",
        "    SequentialLoad,          !- Load Distribution Scheme",
        "    ZoneHVAC:AirDistributionUnit,  !- Zone Equipment 1 Object Type",
        "    Zone1DirectAirADU,       !- Zone Equipment 1 Name",
        "    1,                       !- Zone Equipment 1 Cooling Sequence",
        "    1;                       !- Zone Equipment 1 Heating or No-Load Sequence",

        "  ZoneHVAC:AirDistributionUnit,",
        "    Zone1DirectAirADU,       !- Name",
        "    Zone 1 OA Inlet Node,    !- Air Distribution Unit Outlet Node Name",
        "    AirTerminal:SingleDuct:ConstantVolume:NoReheat,  !- Air Terminal Object Type",
        "    Zone1DirectAir;          !- Air Terminal Name",

        "  NodeList,",
        "    Zone1Inlets,             !- Name",
        "    Zone 1 OA Inlet Node;    !- Node 1 Name",

        "  Schedule:Compact,",
        "    CyclingFanSch,           !- Name",
        "    Fraction,                !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: AllDays,            !- Field 2",
        "    Until: 24:00,0.0;        !- Field 3",

        "  Material:NoMass,",
        "    R19LAYER,                !- Name",
        "    Rough,                   !- Roughness",
        "    3.344,                   !- Thermal Resistance {m2-K/W}",
        "    0.9000000,               !- Thermal Absorptance",
        "    0.7500000,               !- Solar Absorptance",
        "    0.7500000;               !- Visible Absorptance",

        "  Material,",
        "    C5 - 4 IN HW CONCRETE,   !- Name",
        "    MediumRough,             !- Roughness",
        "    0.1014984,               !- Thickness {m}",
        "    1.729577,                !- Conductivity {W/m-K}",
        "    2242.585,                !- Density {kg/m3}",
        "    836.8000,                !- Specific Heat {J/kg-K}",
        "    0.9000000,               !- Thermal Absorptance",
        "    0.6500000,               !- Solar Absorptance",
        "    0.6500000;               !- Visible Absorptance",

        "  Material,",
        "    1IN Stucco,              !- Name",
        "    Smooth,                  !- Roughness",
        "    0.0253,                  !- Thickness {m}",
        "    0.6918,                  !- Conductivity {W/m-K}",
        "    1858.0000,               !- Density {kg/m3}",
        "    837.0000,                !- Specific Heat {J/kg-K}",
        "    0.9000,                  !- Thermal Absorptance",
        "    0.9200,                  !- Solar Absorptance",
        "    0.9200;                  !- Visible Absorptance",

        "  Material,",
        "    8IN Concrete HW,         !- Name",
        "    MediumRough,             !- Roughness",
        "    0.2033,                  !- Thickness {m}",
        "    1.7296,                  !- Conductivity {W/m-K}",
        "    2243.0000,               !- Density {kg/m3}",
        "    837.0000,                !- Specific Heat {J/kg-K}",
        "    0.9000,                  !- Thermal Absorptance",
        "    0.6500,                  !- Solar Absorptance",
        "    0.6500;                  !- Visible Absorptance",

        "  Material,",
        "    Wall Insulation [5],     !- Name",
        "    MediumRough,             !- Roughness",
        "    0.0453,                  !- Thickness {m}",
        "    0.0432,                  !- Conductivity {W/m-K}",
        "    91.0000,                 !- Density {kg/m3}",
        "    837.0000,                !- Specific Heat {J/kg-K}",
        "    0.9000,                  !- Thermal Absorptance",
        "    0.5000,                  !- Solar Absorptance",
        "    0.5000;                  !- Visible Absorptance",

        "  Material,",
        "    1/2IN Gypsum,            !- Name",
        "    Smooth,                  !- Roughness",
        "    0.0127,                  !- Thickness {m}",
        "    0.1600,                  !- Conductivity {W/m-K}",
        "    784.9000,                !- Density {kg/m3}",
        "    830.0000,                !- Specific Heat {J/kg-K}",
        "    0.9000,                  !- Thermal Absorptance",
        "    0.9200,                  !- Solar Absorptance",
        "    0.9200;                  !- Visible Absorptance",

        "  Construction,",
        "    ext-walls,               !- Name",
        "    1IN Stucco,              !- Outside Layer",
        "    8IN Concrete HW,         !- Layer 2",
        "    Wall Insulation [5],     !- Layer 3",
        "    1/2IN Gypsum;            !- Layer 4",

        "  Construction,",
        "    FLOOR,                   !- Name",
        "    C5 - 4 IN HW CONCRETE;   !- Outside Layer",

        "  Construction,",
        "    ROOF19,                  !- Name",
        "    R19LAYER;                !- Outside Layer",

        "  Site:GroundTemperature:BuildingSurface,18.89,18.92,19.02,19.12,19.21,19.23,19.07,19.32,19.09,19.21,19.13,18.96;",

        "  Zone,",
        "    SPACE1-1,                !- Name",
        "    0.0000000E+00,           !- Direction of Relative North {deg}",
        "    0.0000000E+00,           !- X Origin {m}",
        "    0.0000000E+00,           !- Y Origin {m}",
        "    0.0000000E+00,           !- Z Origin {m}",
        "    1,                       !- Type",
        "    1,                       !- Multiplier",
        "    autocalculate,           !- Ceiling Height {m}",
        "    autocalculate;           !- Volume {m3}",

        "  GlobalGeometryRules,",
        "    UpperLeftCorner,         !- Starting Vertex Position",
        "    CounterClockWise,        !- Vertex Entry Direction",
        "    World;                   !- Coordinate System",

        "  BuildingSurface:Detailed,",
        "    Zn001:Wall001,           !- Name",
        "    Wall,                    !- Surface Type",
        "    ext-walls,               !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.5000000,               !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    0.0000000E+00,0.0000000E+00,4.572000,  !- X,Y,Z ==> Vertex 1 {m}",
        "    0.0000000E+00,0.0000000E+00,0.0000000E+00,  !- X,Y,Z ==> Vertex 2 {m}",
        "    15.24000,0.0000000E+00,0.0000000E+00,  !- X,Y,Z ==> Vertex 3 {m}",
        "    15.24000,0.0000000E+00,4.572000;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Wall002,           !- Name",
        "    Wall,                    !- Surface Type",
        "    ext-walls,               !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.5000000,               !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    15.24000,0.0000000E+00,4.572000,  !- X,Y,Z ==> Vertex 1 {m}",
        "    15.24000,0.0000000E+00,0.0000000E+00,  !- X,Y,Z ==> Vertex 2 {m}",
        "    15.24000,15.24000,0.0000000E+00,  !- X,Y,Z ==> Vertex 3 {m}",
        "    15.24000,15.24000,4.572000;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Wall003,           !- Name",
        "    Wall,                    !- Surface Type",
        "    ext-walls,               !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.5000000,               !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    15.24000,15.24000,4.572000,  !- X,Y,Z ==> Vertex 1 {m}",
        "    15.24000,15.24000,0.0000000E+00,  !- X,Y,Z ==> Vertex 2 {m}",
        "    0.0000000E+00,15.24000,0.0000000E+00,  !- X,Y,Z ==> Vertex 3 {m}",
        "    0.0000000E+00,15.24000,4.572000;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Wall004,           !- Name",
        "    Wall,                    !- Surface Type",
        "    ext-walls,               !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.5000000,               !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    0.0000000E+00,15.24000,4.572000,  !- X,Y,Z ==> Vertex 1 {m}",
        "    0.0000000E+00,15.24000,0.0000000E+00,  !- X,Y,Z ==> Vertex 2 {m}",
        "    0.0000000E+00,0.0000000E+00,0.0000000E+00,  !- X,Y,Z ==> Vertex 3 {m}",
        "    0.0000000E+00,0.0000000E+00,4.572000;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Flr001,            !- Name",
        "    Floor,                   !- Surface Type",
        "    FLOOR,                   !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Ground,                  !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    NoSun,                   !- Sun Exposure",
        "    NoWind,                  !- Wind Exposure",
        "    1.000000,                !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    15.24000,0.000000,0.0,  !- X,Y,Z ==> Vertex 1 {m}",
        "    0.000000,0.000000,0.0,  !- X,Y,Z ==> Vertex 2 {m}",
        "    0.000000,15.24000,0.0,  !- X,Y,Z ==> Vertex 3 {m}",
        "    15.24000,15.24000,0.0;  !- X,Y,Z ==> Vertex 4 {m}",

        "  BuildingSurface:Detailed,",
        "    Zn001:Roof001,           !- Name",
        "    Roof,                    !- Surface Type",
        "    ROOF19,                  !- Construction Name",
        "    SPACE1-1,                !- Zone Name",
        "    ,                        !- Space Name",
        "    Outdoors,                !- Outside Boundary Condition",
        "    ,                        !- Outside Boundary Condition Object",
        "    SunExposed,              !- Sun Exposure",
        "    WindExposed,             !- Wind Exposure",
        "    0.0000000E+00,           !- View Factor to Ground",
        "    4,                       !- Number of Vertices",
        "    0.000000,15.24000,4.572,  !- X,Y,Z ==> Vertex 1 {m}",
        "    0.000000,0.000000,4.572,  !- X,Y,Z ==> Vertex 2 {m}",
        "    15.24000,0.000000,4.572,  !- X,Y,Z ==> Vertex 3 {m}",
        "    15.24000,15.24000,4.572;  !- X,Y,Z ==> Vertex 4 {m}",

        "  Sizing:Plant,",
        "    Hot Water Loop,          !- Plant or Condenser Loop Name",
        "    heating,                 !- Loop Type",
        "    82.,                     !- Design Loop Exit Temperature {C}",
        "    11;                      !- Loop Design Temperature Difference {deltaC}",

        "  PlantLoop,",
        "    Hot Water Loop,          !- Name",
        "    Water,                   !- Fluid Type",
        "    ,                        !- User Defined Fluid Type",
        "    Hot Loop Operation,      !- Plant Equipment Operation Scheme Name",
        "    HW Supply Outlet Node,   !- Loop Temperature Setpoint Node Name",
        "    100,                     !- Maximum Loop Temperature {C}",
        "    10,                      !- Minimum Loop Temperature {C}",
        "    Autosize,                !- Maximum Loop Flow Rate {m3/s}",
        "    0.0,                     !- Minimum Loop Flow Rate {m3/s}",
        "    autocalculate,           !- Plant Loop Volume {m3}",
        "    HW Supply Inlet Node,    !- Plant Side Inlet Node Name",
        "    HW Supply Outlet Node,   !- Plant Side Outlet Node Name",
        "    Heating Supply Side Branches,  !- Plant Side Branch List Name",
        "    Heating Supply Side Connectors,  !- Plant Side Connector List Name",
        "    HW Demand Inlet Node,    !- Demand Side Inlet Node Name",
        "    HW Demand Outlet Node,   !- Demand Side Outlet Node Name",
        "    Heating Demand Side Branches,  !- Demand Side Branch List Name",
        "    Heating Demand Side Connectors,  !- Demand Side Connector List Name",
        "    Optimal,                 !- Load Distribution Scheme",
        "    ,                        !- Availability Manager List Name",
        "    ,                        !- Plant Loop Demand Calculation Scheme",
        "    ,                        !- Common Pipe Simulation",
        "    ,                        !- Pressure Simulation Type",
        "    ;                        !- Loop Circulation Time",

        "  SetpointManager:Scheduled,",
        "    Hot Water Loop Setpoint Manager,  !- Name",
        "    Temperature,             !- Control Variable",
        "    HW Loop Temp Schedule,   !- Schedule Name",
        "    Hot Water Loop Setpoint Node List;  !- Setpoint Node or NodeList Name",

        "  Schedule:Compact,",
        "    HW LOOP TEMP SCHEDULE,   !- Name",
        "    TEMPERATURE,             !- Schedule Type Limits Name",
        "    Through: 12/31,          !- Field 1",
        "    For: Alldays,            !- Field 2",
        "    Until: 24:00,82.0;       !- Field 3",

        "  NodeList,",
        "    Hot Water Loop Setpoint Node List,  !- Name",
        "    HW Supply Outlet Node;   !- Node 1 Name",

        "  BranchList,",
        "    Heating Supply Side Branches,  !- Name",
        "    Heating Supply Inlet Branch,  !- Branch 1 Name",
        "    Heating Purchased Hot Water Branch,  !- Branch 2 Name",
        "    Heating Supply Bypass Branch,  !- Branch 3 Name",
        "    Heating Supply Outlet Branch;  !- Branch 4 Name",

        "  ConnectorList,",
        "    Heating Supply Side Connectors,  !- Name",
        "    Connector:Splitter,      !- Connector 1 Object Type",
        "    Heating Supply Splitter, !- Connector 1 Name",
        "    Connector:Mixer,         !- Connector 2 Object Type",
        "    Heating Supply Mixer;    !- Connector 2 Name",

        "  Connector:Splitter,",
        "    Heating Supply Splitter, !- Name",
        "    Heating Supply Inlet Branch,  !- Inlet Branch Name",
        "    Heating Purchased Hot Water Branch,  !- Outlet Branch 1 Name",
        "    Heating Supply Bypass Branch;  !- Outlet Branch 2 Name",

        "  Connector:Mixer,",
        "    Heating Supply Mixer,    !- Name",
        "    Heating Supply Outlet Branch,  !- Outlet Branch Name",
        "    Heating Purchased Hot Water Branch,  !- Inlet Branch 1 Name",
        "    Heating Supply Bypass Branch;  !- Inlet Branch 2 Name",

        "  Branch,",
        "    Heating Supply Inlet Branch,  !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pump:VariableSpeed,      !- Component 1 Object Type",
        "    HW Circ Pump,            !- Component 1 Name",
        "    HW Supply Inlet Node,    !- Component 1 Inlet Node Name",
        "    HW Pump Outlet Node;     !- Component 1 Outlet Node Name",

        "  Branch,",
        "    Heating Purchased Hot Water Branch,  !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    DistrictHeating:Water,         !- Component 1 Object Type",
        "    Purchased Heating,       !- Component 1 Name",
        "    Purchased Heat Inlet Node,  !- Component 1 Inlet Node Name",
        "    Purchased Heat Outlet Node;  !- Component 1 Outlet Node Name",

        "  Branch,",
        "    Heating Supply Bypass Branch,  !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    Heating Supply Side Bypass,  !- Component 1 Name",
        "    Heating Supply Bypass Inlet Node,  !- Component 1 Inlet Node Name",
        "    Heating Supply Bypass Outlet Node;  !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    Heating Supply Side Bypass,  !- Name",
        "    Heating Supply Bypass Inlet Node,  !- Inlet Node Name",
        "    Heating Supply Bypass Outlet Node;  !- Outlet Node Name",

        "  Branch,",
        "    Heating Supply Outlet Branch,  !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    Heating Supply Outlet,   !- Component 1 Name",
        "    Heating Supply Exit Pipe Inlet Node,  !- Component 1 Inlet Node Name",
        "    HW Supply Outlet Node;   !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    Heating Supply Outlet,   !- Name",
        "    Heating Supply Exit Pipe Inlet Node,  !- Inlet Node Name",
        "    HW Supply Outlet Node;   !- Outlet Node Name",

        "  Pump:VariableSpeed,",
        "    HW Circ Pump,            !- Name",
        "    HW Supply Inlet Node,    !- Inlet Node Name",
        "    HW Pump Outlet Node,     !- Outlet Node Name",
        "    autosize,                !- Design Maximum Flow Rate {m3/s}",
        "    179352,                  !- Design Pump Head {Pa}",
        "    autosize,                !- Design Power Consumption {W}",
        "    0.9,                     !- Motor Efficiency",
        "    0.0,                     !- Fraction of Motor Inefficiencies to Fluid Stream",
        "    0,                       !- Coefficient 1 of the Part Load Performance Curve",
        "    1,                       !- Coefficient 2 of the Part Load Performance Curve",
        "    0,                       !- Coefficient 3 of the Part Load Performance Curve",
        "    0,                       !- Coefficient 4 of the Part Load Performance Curve",
        "    0,                       !- Design Minimum Flow Rate {m3/s}",
        "    INTERMITTENT;            !- Pump Control Type",

        "  BranchList,",
        "    Heating Demand Side Branches,  !- Name",
        "    ZonesHWInletBranch,      !- Branch 1 Name",
        "    Zone1HWBranch,           !- Branch 2 Name",
        "    ZonesHWBypassBranch,     !- Branch 5 Name",
        "    ZonesHWOutletBranch;     !- Branch 6 Name",

        "  ConnectorList,",
        "    Heating Demand Side Connectors,  !- Name",
        "    Connector:Splitter,      !- Connector 1 Object Type",
        "    Zones HW Splitter,       !- Connector 1 Name",
        "    Connector:Mixer,         !- Connector 2 Object Type",
        "    Zones HW Mixer;          !- Connector 2 Name",

        "  Connector:Splitter,",
        "    Zones HW Splitter,       !- Name",
        "    ZonesHWInletBranch,      !- Inlet Branch Name",
        "    Zone1HWBranch,           !- Outlet Branch 1 Name",
        "    ZonesHWBypassBranch;     !- Outlet Branch 4 Name",

        "  Connector:Mixer,",
        "    Zones HW Mixer,          !- Name",
        "    ZonesHWOutletBranch,     !- Outlet Branch Name",
        "    Zone1HWBranch,           !- Inlet Branch 1 Name",
        "    ZonesHWBypassBranch;     !- Inlet Branch 4 Name",

        "  Branch,",
        "    ZonesHWInletBranch,      !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    ZonesHWInletPipe,        !- Component 1 Name",
        "    HW Demand Inlet Node,    !- Component 1 Inlet Node Name",
        "    HW Demand Entrance Pipe Outlet Node;  !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    ZonesHWInletPipe,        !- Name",
        "    HW Demand Inlet Node,    !- Inlet Node Name",
        "    HW Demand Entrance Pipe Outlet Node;  !- Outlet Node Name",

        "  Branch,",
        "    ZonesHWOutletBranch,     !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    ZonesHWOutletPipe,       !- Component 1 Name",
        "    HW Demand Exit Pipe Inlet Node,  !- Component 1 Inlet Node Name",
        "    HW Demand Outlet Node;   !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    ZonesHWOutletPipe,       !- Name",
        "    HW Demand Exit Pipe Inlet Node,  !- Inlet Node Name",
        "    HW Demand Outlet Node;   !- Outlet Node Name",

        "  Branch,",
        "    Zone1HWBranch,           !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Coil:Heating:Water,      !- Component 1 Object Type",
        "    OA Preheat HW Coil,      !- Component 1 Name",
        "    HWCoil Water InletNode,  !- Component 1 Inlet Node Name",
        "    HWCoil Water OutletNode; !- Zone1UnitHeatHWOutletNode;  !- Component 1 Outlet Node Name",

        "  Branch,",
        "    ZonesHWBypassBranch,     !- Name",
        "    ,                        !- Pressure Drop Curve Name",
        "    Pipe:Adiabatic,          !- Component 1 Object Type",
        "    ZonesHWBypassPipe,       !- Component 1 Name",
        "    ZonesHWBypassInletNode,  !- Component 1 Inlet Node Name",
        "    ZonesHWBypassOutletNode; !- Component 1 Outlet Node Name",

        "  Pipe:Adiabatic,",
        "    ZonesHWBypassPipe,       !- Name",
        "    ZonesHWBypassInletNode,  !- Inlet Node Name",
        "    ZonesHWBypassOutletNode; !- Outlet Node Name",

        "  PlantEquipmentOperationSchemes,",
        "    Hot Loop Operation,      !- Name",
        "    PlantEquipmentOperation:HeatingLoad,  !- Control Scheme 1 Object Type",
        "    Purchased Heating Only,  !- Control Scheme 1 Name",
        "    ON;                      !- Control Scheme 1 Schedule Name",

        "  PlantEquipmentOperation:HeatingLoad,",
        "    Purchased Heating Only,  !- Name",
        "    0,                       !- Load Range 1 Lower Limit {W}",
        "    1000000,                 !- Load Range 1 Upper Limit {W}",
        "    heating plant;           !- Range 1 Equipment List Name",

        "  PlantEquipmentList,",
        "    heating plant,           !- Name",
        "    DistrictHeating:Water,         !- Equipment 1 Object Type",
        "    Purchased Heating;       !- Equipment 1 Name",

        "  DistrictHeating:Water,",
        "    Purchased Heating,       !- Name",
        "    Purchased Heat Inlet Node,  !- Hot Water Inlet Node Name",
        "    Purchased Heat Outlet Node,  !- Hot Water Outlet Node Name",
        "    1000000;                 !- Nominal Capacity {W}",

        "  Coil:Heating:Water,",
        "    OA Preheat HW Coil,      !- Name",
        "    FanAndCoilAvailSched,    !- Availability Schedule Name",
        "    autosize,                !- U-Factor Times Area Value {W/K}",
        "    autosize,                !- Maximum Water Flow Rate {m3/s}",
        "    HWCoil Water InletNode,  !- Zone1UnitHeatHWInletNode,!- Water Inlet Node Name",
        "    HWCoil Water OutletNode, !- Water Outlet Node Name",
        "    Outside Air Inlet Node,  !- Air Inlet Node Name",
        "    HW Coil Air OutletNode,  !- Air Outlet Node Name",
        "    UFactorTimesAreaAndDesignWaterFlowRate,  !- Performance Input Method",
        "    autosize,                !- Rated Capacity {W}",
        "    82.2,                    !- Rated Inlet Water Temperature {C}",
        "    16.6,                    !- Rated Inlet Air Temperature {C}",
        "    71.1,                    !- Rated Outlet Water Temperature {C}",
        "    32.2,                    !- Rated Outlet Air Temperature {C}",
        "    ;                        !- Rated Ratio for Air and Water Convection",
    });
    ASSERT_TRUE(process_idf(idf_objects));

    // OutputProcessor::TimeValue.allocate(2);
    SimulationManager::ManageSimulation(*state);

    EXPECT_EQ(1, state->dataAirLoop->NumOASystems);
    EXPECT_EQ("OA SYS 1", state->dataAirLoop->OutsideAirSys(OASysNum).Name);
    EXPECT_EQ(2, state->dataAirLoop->OutsideAirSys(OASysNum).NumComponents);                       // there are two components in OA system
    EXPECT_EQ("OA PREHEAT HW COIL", state->dataAirLoop->OutsideAirSys(OASysNum).ComponentName(1)); // pre heat hot water coil
    EXPECT_EQ(state->dataWaterCoils->WaterCoil(1).Name, state->dataAirLoop->OutsideAirSys(OASysNum).ComponentName(1)); // pre heat hot water coil
    EXPECT_EQ("OA MIXING BOX", state->dataAirLoop->OutsideAirSys(OASysNum).ComponentName(2));                          // OA mixer

    // simulate the outdoor air system
    ManageOutsideAirSystem(*state, state->dataAirLoop->OutsideAirSys(OASysNum).Name, false, AirLoopNum, OASysNum);

    EXPECT_DOUBLE_EQ(state->dataWaterCoils->WaterCoil(1).InletAirTemp,
                     -17.3); // preheat Hot Water coil air inlet temp is the heating design day outdoor air temp

    EXPECT_DOUBLE_EQ(11.6,
                     state->dataLoopNodes->Node(state->dataWaterCoils->WaterCoil(1).AirOutletNodeNum)
                         .TempSetPoint);                                        // check the setpoint at the preheat Hot Water coil air outlet node
    EXPECT_NEAR(11.6, state->dataWaterCoils->WaterCoil(1).OutletAirTemp, 0.01); // preheat hot water coil is on and is heating the OA air stream

    AirInletNodeNum = state->dataWaterCoils->WaterCoil(1).AirInletNodeNum;
    CpAir = PsyCpAirFnW(state->dataLoopNodes->Node(AirInletNodeNum).HumRat);
    EXPECT_NEAR(state->dataWaterCoils->WaterCoil(1).TotWaterHeatingCoilRate,
                state->dataWaterCoils->WaterCoil(1).InletAirMassFlowRate * CpAir *
                    (state->dataWaterCoils->WaterCoil(1).OutletAirTemp - state->dataWaterCoils->WaterCoil(1).InletAirTemp),
                1.0);

    // test that OA sys water coil bypasses normal controller calls before air loop simulation
    EXPECT_EQ("PREHEAT COIL CONTROLLER", state->dataHVACControllers->ControllerProps(1).ControllerName);
    EXPECT_TRUE(state->dataHVACControllers->ControllerProps(1).BypassControllerCalc);
    // test that water coil knows which controller controls the HW coil
    EXPECT_EQ(state->dataWaterCoils->WaterCoil(1).ControllerIndex, 1);
}

} // namespace EnergyPlus
